package com.aierjun.ani.widget.wrappingViewpager;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.Fragment;

import com.aierjun.ani.R;
import com.aierjun.ani.widget.tablayout.PagerSlidingTabStrip;

/**
 * Created by Ani_aierJun on 2017/10/12.
 */

public class TestSample extends Fragment{
    private WrappingViewPager viewPagerThree;
    private PagerSlidingTabStrip pagerSlidingTabStrip;


    public void test(Activity context){

        //viewPagerThree = (WrappingViewPager) findViewById(R.id.view_pager_content_story);

        viewPagerThree.setAdapter(new WrappingFragmentPagerAdapter(getActivity().getSupportFragmentManager()) {
            @Override
            public Fragment getItem(int position) {
                switch (position) {
                    case 0:
//                        return OneFragment.getInstance();
                    case 1:
//                        return TwoFragment.getInstance();
                    case 2:
//                        return ThreeFragment.getInstance();
                    default:
//                        return OneFragment.getInstance();
                        return null;
                }
            }

            @Override
            public int getCount() {
                return 3;
            }

            @Override
            public CharSequence getPageTitle(int position) {
                switch (position) {
                    case 0:
                        return getString(R.string.one);
                    case 1:
                        return getString(R.string.two);
                    case 2:
                        return getString(R.string.three);
                    default:
                        return getString(R.string.four);
                }
            }
        });

        //pagerSlidingTabStrip= (PagerSlidingTabStrip) findViewById(R.id.myworkorder_tablayout);

        if (pagerSlidingTabStrip != null) {
            pagerSlidingTabStrip.setIndicatorHeight(3);
            pagerSlidingTabStrip.setUnderlineHeight(1);
            pagerSlidingTabStrip.setBackgroundColor(getResources().getColor(android.R.color.white));
            pagerSlidingTabStrip.setIndicatorColor(getResources().getColor(android.R.color.holo_red_light));
            pagerSlidingTabStrip.setUnderlineColor(getResources().getColor(android.R.color.darker_gray));
            pagerSlidingTabStrip.setViewPager(viewPagerThree);
        }
    }
}
